package com.yx1996.management.Listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.yx1996.management.Bean.User;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Component
public class ExcelListener extends AnalysisEventListener {

    private List<User> list = new ArrayList<>();

    public List<User> getdata() {
        return this.list;

    }


    @Override

    public void invoke(Object o, AnalysisContext analysisContext) {
        list.add((User) o);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}
